#!/usr/bin/env python
# -*- coding:utf-8 -*-

# 也是容器组件，类似于Frame，但它支持添加标题。有点类似于C#中的GroupBox控件。
# Labelframe有两点不同于Frame:
# Labelframe默认的边框使tk.GROOVE，relief=tk.GROOVE
# Labelframe还可以再边框写文字，即：text="文字",边框文字的位置默认是 labelanchor="wn"
import tkinter as tk



def main():
    win = tk.Tk()
    win.geometry('1000x618+100+150')

    # 定义第一个容器
    frame_left = tk.LabelFrame(win, text="国家层面", labelanchor="n")
    frame_left.place(relx=0.2, rely=0.2, relwidth=0.3, relheight=0.6)

    label_1 = tk.Label(frame_left, text="富强")
    label_1.place(relx=0.2, rely=0.2)

    label_2 = tk.Label(frame_left, text="民主")
    label_2.place(relx=0.6, rely=0.2)

    label_3 = tk.Label(frame_left, text="文明")
    label_3.place(relx=0.2, rely=0.6)

    label_4 = tk.Label(frame_left, text="和谐")
    label_4.place(relx=0.6, rely=0.6)

    # 定义第二个容器
    frame_right = tk.LabelFrame(win, text="社会层面", labelanchor="n")
    frame_right.place(relx=0.5, rely=0.2, relwidth=0.3, relheight=0.6)
    label_1 = tk.Label(frame_right, text="自由")
    label_1.place(relx=0.2, rely=0.2)

    label_2 = tk.Label(frame_right, text="平等")
    label_2.place(relx=0.6, rely=0.2)

    label_3 = tk.Label(frame_right, text="公正")
    label_3.place(relx=0.2, rely=0.6)

    label_4 = tk.Label(frame_right, text="法治")
    label_4.place(relx=0.6, rely=0.6)

    win.mainloop()


if __name__ == "__main__":
    main()
